<?php use_helper('Text'); ?>

<?php include_partial('back/show', array('uri' => '@localized_homepage')); ?>
<h1 class="title">Equipes de CPF Aizenay</h1>
<div class="box_relief yellow">
    <?php echo strip_tags($announcement->getDescription(ESC_RAW)) ?>
</div>

<ul>
    <?php
    $i = 0;
    foreach($teams_list as $team){ ?>
        <li class="l_<?php echo $i%2 ?>">
            <h3><?php echo $team['name'] ?></h3>
            <div class="picture">
                <?php $hasLightBox = !is_null($team['sfAsset']['filename']) ? true : false; ?>
                <?php $width= '200'; $height = '200' ?>
                <?php if($hasLightBox){ ?>
                    <?php $imagesAttributes = Utils::getImageSize($team['sfAsset'][ 'Folder' ][ 'relative_path' ], $team['sfAsset'], 285, null); ?>
                    <?php $width = $imagesAttributes['large']['width']; $height = $imagesAttributes['large']['height'] ?>
                    <a class="lightbox" href="<?php echo $imagesAttributes['large']['url'] ?>" title="<?php echo $team['name'] ?>">
                <?php } ?>
                    <img title="<?php echo $team['name'] ?>" alt="<?php echo $team['name'] ?>"
                         src="<?php echo ($hasLightBox ? $imagesAttributes['large']['url'] : "/images/nophoto.png" ) ?>" width="<?php echo $width ?>" height="<?php echo $height ?>" />
                <?php if($hasLightBox){ ?>
                    </a>
                <?php } ?>
            </div>
            <?php if(!empty($team['description'])){ ?>
                <p class="desc"><?php echo truncate_text(strip_tags($team->getRaw('description')), 200, '...') ?></p>
            <?php } ?>
        </li>

    <?php
    $i++;
    }?>
</ul>
<div class="push_float_left"></div>